﻿using Demo.ProductManager.Products;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;

namespace Demo.ProductManager.EntityFrameworkCore;

[ConnectionStringName(ProductManagerDbProperties.ConnectionStringName)]
public class ProductManagerDbContext : AbpDbContext<ProductManagerDbContext>, IProductManagerDbContext
{
    /* Add DbSet for each Aggregate Root here. Example:
     * public DbSet<Question> Questions { get; set; }
     */
    public DbSet<Product> Products { get; set; }

    public ProductManagerDbContext(DbContextOptions<ProductManagerDbContext> options) 
        : base(options)
    {

    }

    protected override void OnModelCreating(ModelBuilder builder)
    {
        base.OnModelCreating(builder);

        builder.ConfigureProductManager();
    }
}